VERSION 5.00
Begin VB.Form frmQuadratic 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "*"
   ClientHeight    =   3735
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4770
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   Icon            =   "frmQuadratic.frx":0000
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3735
   ScaleWidth      =   4770
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "*"
      Height          =   375
      Left            =   3600
      TabIndex        =   15
      Top             =   3000
      Width           =   1095
   End
   Begin VB.CommandButton cmdCalculate 
      Caption         =   "*"
      Default         =   -1  'True
      Height          =   375
      Left            =   2280
      TabIndex        =   14
      Top             =   3000
      Width           =   1095
   End
   Begin VB.Frame fmeInput 
      Caption         =   "*"
      Height          =   1575
      Left            =   120
      TabIndex        =   2
      Top             =   1200
      Width           =   4575
      Begin VB.TextBox txtInput 
         ForeColor       =   &H00000080&
         Height          =   285
         Index           =   2
         Left            =   720
         TabIndex        =   8
         Top             =   1080
         Width           =   1455
      End
      Begin VB.TextBox txtInput 
         ForeColor       =   &H00000080&
         Height          =   285
         Index           =   1
         Left            =   720
         TabIndex        =   7
         Top             =   720
         Width           =   1455
      End
      Begin VB.TextBox txtInput 
         ForeColor       =   &H00000080&
         Height          =   285
         Index           =   0
         Left            =   720
         TabIndex        =   6
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label lblMessages 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000080&
         Height          =   255
         Index           =   9
         Left            =   2760
         TabIndex        =   13
         Top             =   1080
         Width           =   1575
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   8
         Left            =   2400
         TabIndex        =   12
         Top             =   1080
         Width           =   375
      End
      Begin VB.Label lblMessages 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000080&
         Height          =   255
         Index           =   7
         Left            =   2760
         TabIndex        =   11
         Top             =   720
         Width           =   1575
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   6
         Left            =   2400
         TabIndex        =   10
         Top             =   720
         Width           =   375
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   5
         Left            =   2400
         TabIndex        =   9
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   4
         Left            =   240
         TabIndex        =   5
         Top             =   1080
         Width           =   375
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   4
         Top             =   720
         Width           =   375
      End
      Begin VB.Label lblMessages 
         Caption         =   "*"
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   3
         Top             =   360
         Width           =   375
      End
   End
   Begin VB.Label lblMessages 
      Caption         =   "*"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000080&
      Height          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   4455
   End
   Begin VB.Label lblMessages 
      Caption         =   "*"
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   360
      Width           =   4455
   End
End
Attribute VB_Name = "frmQuadratic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCalculate_Click()
    On Error Resume Next
    Dim lpA As Double
    Dim lpB As Double
    Dim lpC As Double
    Dim lpK As Double
    Dim lpResult As Double
    Dim enResult As enuReturns
    Dim strResult As String
    bpDeclareX = False
    bpDeclareY = False
    strResult = CalculateString(txtInput(0).Text, enResult)
    If (enResult = lpRunError) Or (enResult = lpSyntaxError) Then
        MsgBox LoadGlobalLanguage(515), vbCritical, LoadGlobalLanguage(16)
        txtInput(0).SetFocus
        Exit Sub
    Else
        lpA = Val(strResult)
    End If
    strResult = CalculateString(txtInput(1).Text, enResult)
    If (enResult = lpRunError) Or (enResult = lpSyntaxError) Then
        MsgBox LoadGlobalLanguage(516), vbCritical, LoadGlobalLanguage(16)
        txtInput(1).SetFocus
        Exit Sub
    Else
        lpB = Val(strResult)
    End If
    strResult = CalculateString(txtInput(2).Text, enResult)
    If (enResult = lpRunError) Or (enResult = lpSyntaxError) Then
        MsgBox LoadGlobalLanguage(517), vbCritical, LoadGlobalLanguage(16)
        txtInput(2).SetFocus
        Exit Sub
    Else
        lpC = Val(strResult)
    End If
    lpK = lpB ^ 2 - 4 * lpA * lpC
    If lpK < 0 Or lpA = 0 Then
        lblMessages(7).Caption = LoadGlobalLanguage(518)
        lblMessages(9).Caption = LoadGlobalLanguage(518)
        Exit Sub
    Else
        lpResult = (-lpB + Sqr(lpK)) / 2 * lpA
        lblMessages(7).Caption = Trim(Str(lpResult))
        lpResult = (-lpB - Sqr(lpK)) / 2 * lpA
        lblMessages(9).Caption = Trim(Str(lpResult))
    End If
End Sub

Private Sub cmdCancel_Click()
    On Error Resume Next
    Unload frmQuadratic
End Sub

Private Sub Form_Load()
    On Error Resume Next
    frmQuadratic.Caption = LoadGlobalLanguage(514)
    lblMessages(0).Caption = LoadGlobalLanguage(501)
    lblMessages(1).Caption = LoadGlobalLanguage(502)
    lblMessages(2).Caption = LoadGlobalLanguage(503)
    lblMessages(3).Caption = LoadGlobalLanguage(504)
    lblMessages(4).Caption = LoadGlobalLanguage(505)
    lblMessages(5).Caption = LoadGlobalLanguage(506)
    lblMessages(6).Caption = LoadGlobalLanguage(507)
    lblMessages(7).Caption = LoadGlobalLanguage(508)
    lblMessages(8).Caption = LoadGlobalLanguage(509)
    lblMessages(9).Caption = LoadGlobalLanguage(510)
    fmeInput.Caption = LoadGlobalLanguage(511)
    cmdCalculate.Caption = LoadGlobalLanguage(512)
    cmdCancel.Caption = LoadGlobalLanguage(513)
End Sub

Private Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    Cancel = False
    DoEvents
End Sub
